import React from 'react';

const StructSection = ({ data }) => {
    return (
        <div className="response-section struct-section">
            <div className="section-header">
                <span className="section-icon">
                    <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
                        <circle cx="11" cy="11" r="8"/>
                        <path d="M21 21l-4.35-4.35"/>
                        <line x1="11" y1="8" x2="11" y2="14"/>
                        <line x1="8" y1="11" x2="14" y2="11"/>
                    </svg>
                </span>
                <span className="section-title">结构化提取</span>
                <span className="timestamp">{data.timestamp}</span>
            </div>
            <div className="section-content">
                <div className="struct-grid">
                    <div className="struct-item">
                        <span className="struct-label">统计项:</span>
                        <span className="struct-value">
                            {data.data?.items?.join(', ') || '未指定'}
                        </span>
                    </div>
                    <div className="struct-item">
                        <span className="struct-label">统计指标:</span>
                        <span className="struct-value">
                            {data.data?.indicators?.length > 0 
                                ? data.data.indicators.join(', ') 
                                : '全部指标'
                            }
                        </span>
                    </div>
                    <div className="struct-item">
                        <span className="struct-label">时间范围:</span>
                        <span className="struct-value">
                            {data.data?.time?.length > 0 
                                ? data.data.time.join(', ') 
                                : '不限'
                            }
                        </span>
                    </div>
                    <div className="struct-item">
                        <span className="struct-label">地区范围:</span>
                        <span className="struct-value">
                            {data.data?.address || '全省'}
                        </span>
                    </div>
                </div>
            </div>
        </div>
    );
};

export default StructSection;